<template>
  <van-popup v-model="show" position="bottom" round :close-on-click-overlay="false" @click-overlay="()=>{this.$emit('hide')}">
    <ol>
      <li v-for="(item,index) in list" :key="index" @click="chk(item,index)" :style="{color:item.type==='cancel'?'#FED138':(item.chked?'#fff':'#56738B')}">{{item.title}}</li>
    </ol>
  </van-popup>
</template>

<script>
import { Popup } from "vant";
export default {
  props: ["show","list"],
  components: {
    [Popup.name]: Popup
  },
  data() {
    return {
      
    };
  },
  methods:{
      chk(item,index){
          if(item.type === "cancel"){
            this.$emit('hide')
          }else{
            this.$emit("selectUpdate",index)
            this.$emit('hide')
          }
      }
  }
};
</script>

<style lang="scss" scoped>
ol{
    text-align: center;
    background: #293946;
    li{
        border-bottom: solid .003rem #668299;
        color: #56738B;
        font-size: .15rem;
        font-weight: bold;
        height: .44rem;
        line-height: .44rem;
    }
    >li:nth-last-of-type(2){
        border: none;
    }
    >li:nth-last-of-type(1){
        border: none;
        border-top: solid #364A5B .06rem;
    }
}
</style>